using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Boomer.Source.FrameWork.State_and_Screen_Manager.Screen_Manager;
using FrameWork.Source.Texture;
using FrameWork.Source.Resource_Manager;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using FrameWork.Source.Global_variables;

namespace Boomer.Source.FrameWork.State_and_Screen_Manager.State.MenuState.MenuScreen
{
    class AboutScreen : IScreen
    {
        private CTexture m_pAboutBG;

        public AboutScreen(int index, string screenName, bool isActive , ScreenManager manager)
            : base(index, screenName, isActive,manager)
        {
            m_pAboutBG = null;
        }

        public override void init()
        {
            m_pAboutBG = CResourceManager.getInstance().getImage((int)CResourceManager.IMG_MENU.ABOUT);

            base.init();
        }

        public override void update(float deltaTime)
        {
            base.update(deltaTime);
        }

        public override void render()
        {
            m_pAboutBG.drawImage(new Microsoft.Xna.Framework.Vector2(0, 0), Color.White);

            base.render();
        }

        public override void processInput(float deltaTime)
        {
            if ( (Mouse.GetState().LeftButton == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape) ) && CGLOBAL.g_isReleaseKey )
            {
                CGLOBAL.g_isReleaseKey = false;
                this.m_pScreenManager.setScreen("mainmenu screen", false, true);
            }

            if (Mouse.GetState().LeftButton == ButtonState.Released)
            {
                CGLOBAL.g_isReleaseKey = true;
            }
            
            base.processInput(deltaTime);
        }
    }
}
